build: correct cppcheck-misra make rule
authorJan Beulich <jbeulich@suse.com>
Mon, 26 Sep 2022 09:07:48 +0000 (11:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Sep 2022 09:07:48 +0000 (11:07 +0200)
commitc1db78cae105e5b166f41ecac7ccb8cbfd82693f
tree7fb6f579b3cd050f7aec5bd8e164e5bf9fd2fa1f
parent3007efadf74d6146a1c0ff1c2fbbae6b53ce7898
build: correct cppcheck-misra make rule

Having cppcheck-misra.json depend on cppcheck-misra.txt does not
properly address the multiple targets problem. If cppcheck-misra.json
is deleted from the build tree but cppcheck-misra.txt is still there,
nothing will re-generate cppcheck-misra.json.

With GNU make 4.3 or newer we could use the &: grouped target separator,
but since we support older make as well we need to use some other
mechanism. Convert the rule to a pattern one (with "cppcheck" kind of
arbitrarily chosen as the stem), thus making known to make that both
files are created by a single command invocation. Since, as a result,
the JSON file is now "intermediate" from make's perspective, prevent it
being deleted again by making it a prereq of .PRECIOUS.

Fixes: 57caa5375321 ("xen: Add MISRA support to cppcheck make rule")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/Makefile